﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace JasLib
{
    public class ComparisonToComparer<T> : Comparer<T>
    {
        private Comparison<T> _comparisonDelegate = null;
        public ComparisonToComparer(Comparison<T> comparisonDelegate)
        {
            _comparisonDelegate = comparisonDelegate;
        }
        public override int Compare(T x, T y)
        {
            return _comparisonDelegate.Invoke(x, y);
        }
    }

    [Serializable]
    public delegate void EventHandler<TSender, TEventArgs>(TSender sender, TEventArgs e)
        where TSender : class
        where TEventArgs : EventArgs;
}